(function() {

	window.nameLink = function (cellData, dom) {
		console.info(dom.children().get(1).childNodes[0].data);
		var id = dom.children().eq(0).html();
		var url = keter.path+'/paper/topic/mytopic/view/'+id;
		return '<a href="'+url+'">' + cellData + '</a>';
	};
	
	window.getAuthor = function (cellData, dom, data) {
		return data.name;
	};
	
	window.confirm = function (cellData, dom, data) {
		var id = dom.children().eq(0).html();
		var url = keter.reqRoot+'/add/'+id;
		return '<a href="'+url+'">审核</a>';
	};
	
	var get = function () {
		$.ajax({
			url: keter.reqRoot + '/getTopic',
			context: document.body
		}).done(function(data) {
			$('.kt_table').createTable({
				data : data,
				rowFn : function (data) {
				},
				updateFn : function (data) {
					//FIXME: 请求中带上菜单参数
					window.location.href = keter.reqRoot + '/update/'+data[1];
				},
				deleteFn : function (data) {
			
				}
			});
		});
	};

	var main = function () {
		get();
	};

	return main();
})();
